<?php
session_start();

include("SNManager.class.php");
$is_set_user= false;
if($_REQUEST["txtLoginName"] &&    $_REQUEST["txtLogPasswords"])
{
	$db = new SNDataManager();
 	$result= $db->UserAuthenticate(  $_REQUEST["txtLoginName"], $_REQUEST["txtLogPasswords"]);
 	while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
   {
		$is_set_user = true;
		$_SESSION["AccountLogInName"]= $row["LOGIN_NAME"];
		$_SESSION["ADMIN"]= $row["ADMIN_FLAG"];
		$_SESSION["AccountFName"]= $row["FISRT_NAME"];
		$_SESSION["AccountLName"]= $row["LAST_NAME"];
		$_SESSION["LEVELName"]= $row["LEV_NAME"];
		$_SESSION["AccountID"]= $row["ID"];
		$_SESSION["ISLOGIN"]= true;
   }
   if($is_set_user)
   {
    $db->redirect("SearchSNPage.php");
    	//header( "location:SearchSNPage.php" );
		 	//exit(0);
   }
 }
 include("Header.php");

?>

<!-- Article -->
            <div id="adbox"  align="center">
                <h2><span>Sign In</span></h2>
          <form action="" method="post" id="form1" name="form1" >
                <table width="500" border="0" align="center" class="entry" >
	    <tr>
	      <td width="250" class="entry"><div align="right">Login Name : </div></td>
	      <td width="300"  class="entry" ><label for="txtLoginName"></label>
	        <input name="txtLoginName" type="text" id="txtLoginName"  width="300" /></td>
	      </tr>
	    <tr>
	      <td width="250" class="entry"><div align="right">Passwords : </div></td>
	      <td width="300"  class="entry" ><label for="txtLogPasswords"></label>
	        <input name="txtLogPasswords" type="password" id="txtLogPasswords"  width="300" /></td>
	      </tr>
        <tr>
          <td width="250">&nbsp;</td>
          <td align="right"><input name="btnLogIn" type="submit" class="entry" id="btnLogIn" value="Sign In" /></td>
        </tr>
      </table>
      </form>
            </div> 

  <?php
  include("Footer.php");
  ?>
